package Staff

import (
	"supervideo/app/models"
	"supervideo/pkg/database"
)

type Staff struct {
	models.BaseModel

	Name    string `json:"name"`
	Sex     int8   `json:"sex"`
	Country string `json:"country"`
	Type    int8   `json:"type"`

	models.CommonTimestampsField
}

func (Staff *Staff) Create() {
	database.DB.Create(&Staff)
}

func (Staff *Staff) Save() (rowAffected int64) {
	result := database.DB.Save(&Staff)
	return result.RowsAffected
}

func (Staff *Staff) Delete() (rowAffected int64) {
	result := database.DB.Delete(&Staff)
	return result.RowsAffected
}
